<template>
    <input type="text" v-model="res">
    <button @click="btn(res)">点击添加</button>
</template>
<script setup>
    import {ref,defineEmits} from "vue"
    let res =ref('')
    let emits = defineEmits(['add'])
    // let {add} = emits
    let btn = function(a){
        emits('add',a)
        // emits('add',a)
        res.value=''
    }
</script>